﻿Public Class FormVolume
    Private Sub LinkLabel1_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Me.Close()
    End Sub

    Private Sub FormVolume_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Me.Size = New Size(160, 42)
        If My.Settings.PlayerClient = 0 Then
            tbarVol.Maximum = 100
            tbarVol.Value = FormMain.wmp.settings.volume
        ElseIf My.Settings.PlayerClient = 1 Then
            tbarVol.Maximum = 255
            tbarVol.Value = WinampControl.WinampControl.WAGetCurrentVolume()
        End If

        If FormMain.TopMost = True Then Me.TopMost = True
    End Sub
    Dim tmpvol As Integer
    Private Sub chkMute_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkMute.CheckedChanged
        If My.Settings.PlayerClient = 0 Then
            FormMain.wmp.settings.mute = chkMute.Checked
        ElseIf My.Settings.PlayerClient = 1 Then
            If chkMute.Checked = True Then
                WinampControl.WinampControl.SetVolume(0)
            Else
                WinampControl.WinampControl.SetVolume(tbarVol.Value)
            End If
        End If

    End Sub

    Private Sub tbarVol_Scroll(sender As System.Object, e As System.EventArgs) Handles tbarVol.Scroll
        If My.Settings.PlayerClient = 0 Then
            FormMain.wmp.settings.volume = tbarVol.Value
        ElseIf My.Settings.PlayerClient = 1 Then
            WinampControl.WinampControl.SetVolume(tbarVol.Value)
        End If

    End Sub
End Class